package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.domain.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select role from sys_user where id=#{userId}")
    String selectUserPermissions(@Param("userId") Long userId);

    @Select("select * from sys_user where id=#{userId}}")
    User getCurrentUser(@Param("userId") Long userId);
}
